<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/jsp/common/head.jsp"%>
<div class="right">
            <div class="location">
                <strong>你现在所在的位置是:</strong>
                <span>密码修改页面</span>
            </div>
            <div class="providerAdd">
                <form id="userForm" name="userForm" method="post" action="${pageContext.request.contextPath }/user/userPasswordMod">
                    <input type="hidden" name="userPassword" value="${loginUser.userPassword}" id="userPassword">
                    <!--div的class 为error是验证错误，ok是验证成功-->
                    <div class="info"></div>
                    <div class="">
                        <label for="oldPassword">旧密码：</label>
                        <input type="password" name="oldpassword" id="oldpassword" value="" required>
						<font color="red"></font>
                    </div>
                    <div>
                        <label for="newPassword">新密码：</label>
                        <input type="password" name="newpassword" id="newpassword" value="" required>
						<font color="red"></font>
                    </div>
                    <div>
                        <label for="reNewPassword">确认新密码：</label>
                        <input type="password" name="rnewpassword" id="rnewpassword" value="" required>
						<font color="red"></font>
                    </div>
                    <div class="providerAddBtn">
                        <!--<a href="#">保存</a>-->
                        <input type="button" name="save" id="save" value="保存" class="input-button">
                    </div>
                </form>
            </div>
        </div>
    </section>
<%@include file="/jsp/common/foot.jsp" %>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.3.min.js" ></script>
<script type="text/javascript">
    $(function() {
        $("#oldpassword").blur(function () {
            if($("#oldpassword").val() == ""){
                alert("请输入旧密码");
            }else if( $("#userPassword").val() != $("#oldpassword").val()){
                alert("旧密码不正确，请输入正确密码");
            }
        });

        $("#rnewpassword").blur(function () {
            if( $("#newpassword").val() != $("#rnewpassword").val()){
                alert("两次输入密码不一致！！！");
            }
        });

        $("#save").click(function () {
            if( $("#userPassword").val() != $("#oldpassword").val()){
                alert("旧密码不正确，请输入正确密码");
                return false;
            }
            if( $("#newpassword").val() != $("#rnewpassword").val()){
                alert("两次输入密码不一致！！！");
                return false;
            }

            $("#userForm").submit();

        });

    });
</script>